//
//  CYTempViewController.swift
//  MySina
//
//  Created by mac on 2017/1/17.
//  Copyright © 2017年 xinyuan. All rights reserved.
//

import UIKit

class CYTempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = RandomColor()
        setupNav()
    }

    @objc private func rightClick(){
        let tempVc = CYTempViewController()
        navigationController?.pushViewController(tempVc, animated: true)
    }
    
    // MARK: - 设置导航
    private func setupNav(){
        // 设置title
        title = "第\(navigationController?.childViewControllers.count ?? 0)个控制器"
        // 设置右侧按钮
        navigationItem.rightBarButtonItem = UIBarButtonItem(imgName: nil, title: "PUSH", target: self, action: #selector(rightClick))
    }
}
